New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: restore ability to disable color correct rendering #15898
Conversation
7c77850
to
8a88557
Compare
I confirmed that #FF0000 with main.js:
test.html:
|
8a88557
to
fd56b87
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is far from clear to me that this patches all the necessary places, and I'm concerned about continuing support for this flag in the face of future upstream refactors in Chrome's rendering code, but I'm satisfied that at least for this particular version of Chrome that this patch does not change behaviour unless you pass the flag, so I'm approving anyway.
Please be prepared for this flag to get disabled in a future chrome upgrade if you're not around to help port it :)
RendererSettings renderer_settings; | ||
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | ||
+ renderer_settings.enable_color_correct_rendering = | ||
+ !command_line->HasSwitch("disable-color-correct-rendering"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add a string constant kDisableColorCorrectRendering
so that typos will be a compile error :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
In Electron 2.0, `--disable-features=ColorCorrectRendering` could be used to make the app use the display color space (e.g. P3 on Macs) instead of color correcting to sRGB. Because color correct rendering is always enabled on Chromium 62 and later and because `--force-color-profile` has no effect on macOS, apps that need e.g. P3 colors are currently stuck on Electron 2.0. This restores the functionality removed in https://chromium-review.googlesource.com/698347 in the form of the `--disable-color-correct-rendering` switch. This can be removed once web content (including WebGL) learn how to deal with color spaces. That is being tracked at https://crbug.com/634542 and https://crbug.com/711107. As an example of a widely used app using `--disable-features=ColorCorrectRendering`, see VSCode: https://github.com/Microsoft/vscode/blob/3f33ef2593d3efe6eca5230f3d34d3406fb73498/src/main.js#L138-L139 Notes: Add `--disable-color-correct-rendering` switch
fd56b87
to
3af9274
Compare
Release Notes Persisted
|
I was unable to backport this PR to "3-1-x" cleanly; |
I was unable to backport this PR to "4-0-x" cleanly; |
…0-x) Backport of #15898 See that PR for details. Notes: Add `--disable-color-correct-rendering` switch
@poiru did this ever land on 3-0-x? |
This broke in Electron 6 due to some Chromium changes. Test Plan: - Confirm that test case from electron#15898 (comment) now works Notes: Fix disabling color correct rendering with `--disable-color-correct-rendering`
…20356) This broke in Electron 6 due to some Chromium changes. Test Plan: - Confirm that test case from #15898 (comment) now works Notes: Fix disabling color correct rendering with `--disable-color-correct-rendering`
This regressed once again in Electron 8 due to Chromium changes. Test Plan: - Confirm that test case from electron#15898 (comment) now works Notes: Fix disabling color correct rendering with `--disable-color-correct-rendering`
…23787) This regressed once again in Electron 8 due to Chromium changes. Test Plan: - Confirm that test case from #15898 (comment) now works Notes: Fix disabling color correct rendering with `--disable-color-correct-rendering`
This regressed once again in Electron 8 due to Chromium changes. Test Plan: - Confirm that test case from #15898 (comment) now works Notes: Fix disabling color correct rendering with `--disable-color-correct-rendering`
This regressed once again in Electron 8 due to Chromium changes. Test Plan: - Confirm that test case from #15898 (comment) now works Notes: Fix disabling color correct rendering with `--disable-color-correct-rendering`
…23899) This regressed once again in Electron 8 due to Chromium changes. Test Plan: - Confirm that test case from #15898 (comment) now works Notes: Fix disabling color correct rendering with `--disable-color-correct-rendering` Co-authored-by: Biru Mohanathas <birunthan@mohanathas.com>
…23900) * fix: Make the `--disable-color-correct-rendering` switch work again This regressed once again in Electron 8 due to Chromium changes. Test Plan: - Confirm that test case from #15898 (comment) now works Notes: Fix disabling color correct rendering with `--disable-color-correct-rendering` * update patches Co-authored-by: Biru Mohanathas <birunthan@mohanathas.com> Co-authored-by: Electron Bot <anonymous@electronjs.org>
In Electron 2.0,
--disable-features=ColorCorrectRendering
could beused to make the app use the display color space (e.g. P3 on Macs)
instead of color correcting to sRGB. Because color correct rendering is
always enabled on Chromium 62 and later and because
--force-color-profile
has no effect on macOS, apps that need e.g. P3colors are currently stuck on Electron 2.0.
This restores the functionality removed in
https://chromium-review.googlesource.com/698347 in the form of the
--disable-color-correct-rendering
switch.This can be removed once web content (including WebGL) learn how
to deal with color spaces. That is being tracked at
https://crbug.com/634542 and https://crbug.com/711107.
As an example of a widely used app using
--disable-features=ColorCorrectRendering
, see VSCode:https://github.com/Microsoft/vscode/blob/3f33ef2593d3efe6eca5230f3d34d3406fb73498/src/main.js#L138-L139
Notes: Add
--disable-color-correct-rendering
switch